<?php
include_once('common/header.php');
if($AppUI->id <=0 || (isset($_SESSION['search']) && ($_SESSION['search'] <= 0))) {
	$this->_redirect(HOST_BACKEND);
}
$objSearch 	= new Ecore_Search();
$arrMap		= $objSearch->getAll(0, $variable['MAP_LIMIT']['val']);
if(isset($arrMap)) {
	$strFile = CONFIG_FOLDER . 'map.json';
	if(file_exists($strFile)) {
		@unlink($strFile);
	}		
	$strJson	= Zend_Json::encode($arrMap);	
	@file_put_contents($strFile, $strJson);	
}
Ecore_Function::setMsg('Tạo dữ liệu MAP thành công!');
$this->_redirect(isset($_SESSION[SESSION_BACKURL]) ? $_SESSION[SESSION_BACKURL] : HOST_BACKEND);